package com.newlink.building.userinfo.mvp.contract

import com.newlink.building.common_base.base.IModel
import com.newlink.building.common_base.base.IPresenter
import com.newlink.building.common_base.base.IView
import com.newlink.building.common_base.model.bean.Base_AddFamilyManagementBean
import com.newlink.building.common_base.model.bean.AddFamilyManagementData
import com.newlink.building.common_base.model.bean.HttpResult
import com.newlink.building.common_base.model.bean.StatusData
import io.reactivex.Observable

/**
 * @author wangyang
 * @date 2022/10/11
 * @description 我的——家庭管理页面——添加家庭成员页面的Contract
 */
interface Module_UserInfo_FamilyManagementAddContract {

    interface Model : IModel {
        fun addFamilyManagement(
            token: String,
            addFamilyManagementBean: Base_AddFamilyManagementBean
        ): Observable<HttpResult<AddFamilyManagementData>>

        fun addFamilyManagementToKcp(
            token: String,
            addFamilyManagementBean: Base_AddFamilyManagementBean
        )

        fun updateEmail(
            token: String,
            userId: Long,
            email: String
        ): Observable<HttpResult<StatusData>>
    }

    interface View : IView {
        fun addFamilyManagementSuccess(data: AddFamilyManagementData?)
        fun addFamilyManagementFail()
        fun updateEmailSuccess(success: Boolean, email: String)
    }

    interface Presenter : IPresenter<View> {
        fun addFamilyManagement(
            token: String,
            addFamilyManagementBean: Base_AddFamilyManagementBean,
            serverType: Int
        )

        fun updateEmail(token: String, userId: Long, email: String)
    }
}